# Contributor: Taner Tas <taner76@gmail.com>
# Maintainer: Taner Tas <taner76@gmail.com>
pkgname=portmidi
pkgver=217
pkgrel=0
pkgdesc="PortMidi is a platform independent library for MIDI input/output."
url="http://portmedia.sourceforge.net/"
arch="all"
license="MIT"
makedepends="dos2unix cmake alsa-lib-dev"
subpackages="$pkgname-dev"
options="!check" # no testsuite
source="https://downloads.sourceforge.net/portmedia/$pkgname-src-$pkgver.zip
	00_cmake.patch
	01_pmlinux.patch
	02_pmlinuxalsa.patch
	03_pm_test_Makefile.patch
	11-pmlinuxalsa.patch
	13-disablejni.patch
	20-movetest.patch
	21-hardentests.patch
	30-porttime_cmake.patch
	40-test_sysex.patch
	41-pm_linux.patch
	50-change_assert.patch
	51-remove_assert.patch"
builddir="$srcdir"/$pkgname

prepare() {
	cd "$builddir"
	find  . -type f -exec dos2unix -s -q {} \;
	default_prepare
}
build() {
	cd "$builddir"
	cmake . \
	-DCMAKE_BUILD_TYPE="Release" \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=/usr/lib \
	-DCMAKE_CACHEFILE_DIR="$builddir"/build
	make 
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	rm -f "$pkgdir"/usr/lib/*.a
}

sha512sums="d08d4d57429d26d292b5fe6868b7c7a32f2f1d2428f6695cd403a697e2d91629bd4380242ab2720e8f21c895bb75cb56b709fb663a20e8e623120e50bfc5d90b  portmidi-src-217.zip
39a7c30a58f71be517d57d11c1fedfdd7c56cfdf71593f35027323e64c41dd29065791bcce6ce0f373679c9e26caba390867c93904f5efc47605ac05feaccc45  00_cmake.patch
39ce54128b3f9712d47064557d6331bb9a44e65c2b13e2dd36bc474dfa073b391b0f3a8b01da54b0f56a14379ced2967f22b8822da46afaec62972b732b17442  01_pmlinux.patch
032c8777dbda6af1b17fdd7664300c41b6a9ccb06ad2a68595fd8d0216fdbef7452f3c407b2be2eb0445d08243adb8929096df1f3f1ee4d032a2928495acda81  02_pmlinuxalsa.patch
baf8231d0288079b5734e886e8cfe27d48ac5bf4bf181e956f6f0161235d21f3794ef4fcc77e8d6d3a3cf51461fa0c6f065c3b80d711ddfe736f4e6592d65400  03_pm_test_Makefile.patch
fcfc350e37940fd9ebb070f1efc727f1903a8cf23e21866c56b09766a31479a98676327a981f50905c11e93e32119ef56fef9d3a0de51182a85f175b1dfd3155  11-pmlinuxalsa.patch
58c638793f5e4eff7782f9844a7d19cb98e7a763497a03f77dbdc15e60a2d3dcfb2ae94cc3bc7a7ddfd880db8d5dd552dff659f1f300f7635b3a484bec35fb60  13-disablejni.patch
186358ec42a003b943672820ceb71c421b397bb47bb20cdbe92080755bbba3a5238c06632154c72878a92b10e32364d7f8c059fd8f6c864a87a9b9ebe546d15e  20-movetest.patch
8fa0944be2a70b4aede2a1967e1b38c863812245db6d725c0c253457f3443864a9cfba582d96ff0cc9d8fd1dd38fbb2e04e9447d2bd1abb5d2a933728135e8e4  21-hardentests.patch
15e529aa8757c4f74a372bcb43748fb0f88d7fc4c858d00199989ad92d0eb0b2edc72d591ba471ee534b38e5756e1c72255ef93c3eb670a64a7b35a973d8368c  30-porttime_cmake.patch
e52396df909b9ed1f8d58fad929c551a1124a2e5137f635087ac078bdf133162c618a17a9ecc4159acdfc48a640aaae06a4e392aacb1bc69a2389d9cfa18519d  40-test_sysex.patch
4c56ebc01ed51acec3fe4a0b9fe54a6f61cdcb9640f24a076d94788174c4ebd1fd958adcedb355dc78d9a11a22d79cb276eaa2f5248d5790142bd5ced178172e  41-pm_linux.patch
e4ffd1d49569b8279baeec45dd22b58a9724b396b927aa6c10198ab135290fbfb570d373b59317dae1d0a26ce71dcaf568325c728bc9302677d6fd28a74f4749  50-change_assert.patch
a40e268719f949d519285fbed477b587e47434eb9b8d97de5aa4f0e6209e2a24afb8a373d4f7616c88d141525a812e23105f10a0fd457be80c93989286963c56  51-remove_assert.patch"
